package com.wtwd.device.config;

import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ResourceBundleMessageSource;

/**
 * 本地化配置
 * @author zdl
 * @date 2021/11/25 16:15
 */
@Configuration
public class LocaleConfig {
    @Bean("pushMessageLocaleResource")
    public MessageSource pushMessageLocaleResource(){
        ResourceBundleMessageSource resourceBundleMessageSource = new ResourceBundleMessageSource();
        resourceBundleMessageSource.setBasename("i18n/msg");
        resourceBundleMessageSource.setDefaultEncoding("UTF-8");
        return resourceBundleMessageSource;
    }
}
